package com.example.bookmapper.controller;

import com.example.bookmapper.pojo.BookPopularityRank;
import com.example.bookmapper.service.BookPopularityRankService;
import com.example.bookmapper.util.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class BookPopularityRankController {

    @Autowired
    private BookPopularityRankService bookPopularityRankService;

    @GetMapping("/queryAllBookPopularityRank")
    public ResponseResult<List<BookPopularityRank>> queryAllBookPopularityRank() {
        List<BookPopularityRank> bookPopularityRanks = bookPopularityRankService.queryAllBookPopularityRank();
        return new ResponseResult<>("200", "查询成功", bookPopularityRanks);
    }
}

